{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true,
    "pycharm": {
     "name": "#%% md\n"
    }
   },
   "source": [
    "名字的含义：\n",
    "\n",
    "`100_2000_128_1000_0.ipynb`\n",
    "\n",
    "`[tag]_[data_length]_[BS]_[epochs]_[data_id]`"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [],
   "source": [
    "from utils import constants, general\n",
    "import os\n",
    "\n",
    "nb_name_file = general.ipy_nb_name(constants.JUPYTER_TOKEN[\"token_lists\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'num': '100', 'data_length': 2000, 'batch_size': 128, 'epochs': 1000}"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "theNotebook = nb_name_file.split('_')\n",
    "assert len(theNotebook) == 4, 'The number of parameters should be 4'\n",
    "\n",
    "global title_param\n",
    "title_param = {\n",
    "    'num': theNotebook[0],\n",
    "    'data_length': int(theNotebook[1]),\n",
    "    'batch_size': int(theNotebook[2]),\n",
    "    'epochs': int(theNotebook[3]),\n",
    "    'data_id': int(theNotebook[4])\n",
    "}\n",
    "\n",
    "display(title_param)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/musk/anaconda3/envs/HARedit/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:523: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  _np_qint8 = np.dtype([(\"qint8\", np.int8, 1)])\n",
      "/home/musk/anaconda3/envs/HARedit/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:524: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  _np_quint8 = np.dtype([(\"quint8\", np.uint8, 1)])\n",
      "/home/musk/anaconda3/envs/HARedit/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  _np_qint16 = np.dtype([(\"qint16\", np.int16, 1)])\n",
      "/home/musk/anaconda3/envs/HARedit/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:526: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  _np_quint16 = np.dtype([(\"quint16\", np.uint16, 1)])\n",
      "/home/musk/anaconda3/envs/HARedit/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:527: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  _np_qint32 = np.dtype([(\"qint32\", np.int32, 1)])\n",
      "/home/musk/anaconda3/envs/HARedit/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:532: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\n",
      "  np_resource = np.dtype([(\"resource\", np.ubyte, 1)])\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "GPU used: [0], final choose: 0\n"
     ]
    }
   ],
   "source": [
    "import tensorflow as tf\n",
    "\n",
    "calculation_unit = general.getAvailableId()\n",
    "os.environ[\"CUDA_VISIBLE_DEVICES\"] = calculation_unit\n",
    "\n",
    "if calculation_unit != \"-1\":\n",
    "    config = tf.ConfigProto()\n",
    "    config.gpu_options.allow_growth = True\n",
    "    session = tf.Session(config=config)\n",
    "\n",
    "os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Using TensorFlow backend.\n"
     ]
    }
   ],
   "source": [
    "from all_datasets_trainingLY import train_val"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "pycharm": {
     "name": "#%%\n"
    },
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Num datasets :  105\n",
      "\n",
      "******************** Training model for dataset cairo_9999_0 ********************\n",
      "Loading train / test dataset :  ../datasets/casas/ende/cairo/9999/npy/3/cairo-train-x-0.npy ../datasets/casas/ende/cairo/9999/npy/3/cairo-test-x-0.npy\n",
      "Finished loading train dataset..\n",
      "Finished loading test dataset..\n",
      "\n",
      "Number of train samples :  782 Number of test samples :  392\n",
      "Number of classes :  7\n",
      "Sequence length :  2000\n",
      "Class weights :  [0.22477723 2.93984962 3.85221675 1.64285714 2.42857143 1.32993197\n",
      " 5.58571429]\n",
      "Train on 782 samples, validate on 392 samples\n",
      "Epoch 1/1000\n",
      " - 6s - loss: 1.5505 - acc: 0.4706 - val_loss: 1.1240 - val_acc: 0.6327\n",
      "\n",
      "Epoch 00001: loss improved from inf to 1.55054, saving model to ./weights/lstmfcn_8_cells_weights/cairo_9999_0_weights.h5\n",
      "Epoch 2/1000\n",
      " - 3s - loss: 1.1046 - acc: 0.6675 - val_loss: 1.0422 - val_acc: 0.6888\n",
      "\n",
      "Epoch 00002: loss improved from 1.55054 to 1.10459, saving model to ./weights/lstmfcn_8_cells_weights/cairo_9999_0_weights.h5\n",
      "Epoch 3/1000\n",
      " - 3s - loss: 0.9876 - acc: 0.6662 - val_loss: 1.0079 - val_acc: 0.6378\n",
      "\n",
      "Epoch 00003: loss improved from 1.10459 to 0.98763, saving model to ./weights/lstmfcn_8_cells_weights/cairo_9999_0_weights.h5\n",
      "Epoch 4/1000\n",
      " - 3s - loss: 0.9262 - acc: 0.6905 - val_loss: 0.9593 - val_acc: 0.6684\n",
      "\n",
      "Epoch 00004: loss improved from 0.98763 to 0.92616, saving model to ./weights/lstmfcn_8_cells_weights/cairo_9999_0_weights.h5\n",
      "Epoch 5/1000\n",
      " - 3s - loss: 0.9150 - acc: 0.6726 - val_loss: 1.0079 - val_acc: 0.6173\n",
      "\n",
      "Epoch 00005: loss improved from 0.92616 to 0.91502, saving model to ./weights/lstmfcn_8_cells_weights/cairo_9999_0_weights.h5\n",
      "Epoch 6/1000\n",
      " - 3s - loss: 0.8901 - acc: 0.6854 - val_loss: 0.9816 - val_acc: 0.6582\n",
      "\n",
      "Epoch 00006: loss improved from 0.91502 to 0.89006, saving model to ./weights/lstmfcn_8_cells_weights/cairo_9999_0_weights.h5\n",
      "Epoch 7/1000\n",
      " - 3s - loss: 0.8937 - acc: 0.6893 - val_loss: 0.9747 - val_acc: 0.6607\n",
      "\n",
      "Epoch 00007: loss did not improve from 0.89006\n",
      "Epoch 8/1000\n",
      " - 3s - loss: 0.8632 - acc: 0.6995 - val_loss: 0.9812 - val_acc: 0.6556\n",
      "\n",
      "Epoch 00008: loss improved from 0.89006 to 0.86318, saving model to ./weights/lstmfcn_8_cells_weights/cairo_9999_0_weights.h5\n",
      "Epoch 9/1000\n",
      " - 3s - loss: 0.8324 - acc: 0.6957 - val_loss: 0.9822 - val_acc: 0.6556\n",
      "\n",
      "Epoch 00009: loss improved from 0.86318 to 0.83241, saving model to ./weights/lstmfcn_8_cells_weights/cairo_9999_0_weights.h5\n",
      "Epoch 10/1000\n",
      " - 3s - loss: 0.8317 - acc: 0.6982 - val_loss: 0.9183 - val_acc: 0.6964\n",
      "\n",
      "Epoch 00010: loss improved from 0.83241 to 0.83171, saving model to ./weights/lstmfcn_8_cells_weights/cairo_9999_0_weights.h5\n",
      "Epoch 11/1000\n"
     ]
    },
    {
     "ename": "KeyboardInterrupt",
     "evalue": "",
     "output_type": "error",
     "traceback": [
      "\u001B[0;31m---------------------------------------------------------------------------\u001B[0m",
      "\u001B[0;31mKeyboardInterrupt\u001B[0m                         Traceback (most recent call last)",
      "\u001B[0;32m<ipython-input-5-afa0a7058875>\u001B[0m in \u001B[0;36m<module>\u001B[0;34m\u001B[0m\n\u001B[0;32m----> 1\u001B[0;31m \u001B[0mtrain_val\u001B[0m\u001B[0;34m(\u001B[0m\u001B[0mepochs\u001B[0m\u001B[0;34m=\u001B[0m\u001B[0mtitle_param\u001B[0m\u001B[0;34m[\u001B[0m\u001B[0;34m\"epochs\"\u001B[0m\u001B[0;34m]\u001B[0m\u001B[0;34m,\u001B[0m \u001B[0mbatch_size\u001B[0m\u001B[0;34m=\u001B[0m\u001B[0mtitle_param\u001B[0m\u001B[0;34m[\u001B[0m\u001B[0;34m\"batch_size\"\u001B[0m\u001B[0;34m]\u001B[0m\u001B[0;34m)\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[0m",
      "\u001B[0;32m~/project/paperEdit/haredit-lstm-fcn/all_datasets_trainingLY.py\u001B[0m in \u001B[0;36mtrain_val\u001B[0;34m(epochs, batch_size)\u001B[0m\n\u001B[1;32m    243\u001B[0m \u001B[0;34m\u001B[0m\u001B[0m\n\u001B[1;32m    244\u001B[0m                 \u001B[0;31m# comment out the training code to only evaluate !\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[0;32m--> 245\u001B[0;31m                 \u001B[0mtrain_model\u001B[0m\u001B[0;34m(\u001B[0m\u001B[0mmodel\u001B[0m\u001B[0;34m,\u001B[0m \u001B[0mdid\u001B[0m\u001B[0;34m,\u001B[0m \u001B[0mdataset_name_\u001B[0m\u001B[0;34m,\u001B[0m \u001B[0mepochs\u001B[0m\u001B[0;34m=\u001B[0m\u001B[0mepochs\u001B[0m\u001B[0;34m,\u001B[0m \u001B[0mbatch_size\u001B[0m\u001B[0;34m=\u001B[0m\u001B[0mbatch_size\u001B[0m\u001B[0;34m,\u001B[0m \u001B[0mnormalize_timeseries\u001B[0m\u001B[0;34m=\u001B[0m\u001B[0mnormalize_dataset\u001B[0m\u001B[0;34m)\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[0m\u001B[1;32m    246\u001B[0m \u001B[0;34m\u001B[0m\u001B[0m\n\u001B[1;32m    247\u001B[0m                 \u001B[0macc\u001B[0m \u001B[0;34m=\u001B[0m \u001B[0mevaluate_model\u001B[0m\u001B[0;34m(\u001B[0m\u001B[0mmodel\u001B[0m\u001B[0;34m,\u001B[0m \u001B[0mdid\u001B[0m\u001B[0;34m,\u001B[0m \u001B[0mdataset_name_\u001B[0m\u001B[0;34m,\u001B[0m \u001B[0mbatch_size\u001B[0m\u001B[0;34m=\u001B[0m\u001B[0mbatch_size\u001B[0m\u001B[0;34m,\u001B[0m \u001B[0mnormalize_timeseries\u001B[0m\u001B[0;34m=\u001B[0m\u001B[0mnormalize_dataset\u001B[0m\u001B[0;34m)\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n",
      "\u001B[0;32m~/project/paperEdit/haredit-lstm-fcn/utils/keras_utils.py\u001B[0m in \u001B[0;36mtrain_model\u001B[0;34m(model, dataset_id, dataset_prefix, epochs, batch_size, val_subset, cutoff, normalize_timeseries, learning_rate)\u001B[0m\n\u001B[1;32m    131\u001B[0m \u001B[0;34m\u001B[0m\u001B[0m\n\u001B[1;32m    132\u001B[0m     model.fit(X_train, y_train, batch_size=batch_size, epochs=epochs, callbacks=callback_list,\n\u001B[0;32m--> 133\u001B[0;31m               class_weight=class_weight, verbose=2, validation_data=(X_test, y_test))\n\u001B[0m\u001B[1;32m    134\u001B[0m \u001B[0;34m\u001B[0m\u001B[0m\n\u001B[1;32m    135\u001B[0m \u001B[0;34m\u001B[0m\u001B[0m\n",
      "\u001B[0;32m~/anaconda3/envs/HARedit/lib/python3.6/site-packages/keras/engine/training.py\u001B[0m in \u001B[0;36mfit\u001B[0;34m(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, steps_per_epoch, validation_steps, **kwargs)\u001B[0m\n\u001B[1;32m   1037\u001B[0m                                         \u001B[0minitial_epoch\u001B[0m\u001B[0;34m=\u001B[0m\u001B[0minitial_epoch\u001B[0m\u001B[0;34m,\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[1;32m   1038\u001B[0m                                         \u001B[0msteps_per_epoch\u001B[0m\u001B[0;34m=\u001B[0m\u001B[0msteps_per_epoch\u001B[0m\u001B[0;34m,\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[0;32m-> 1039\u001B[0;31m                                         validation_steps=validation_steps)\n\u001B[0m\u001B[1;32m   1040\u001B[0m \u001B[0;34m\u001B[0m\u001B[0m\n\u001B[1;32m   1041\u001B[0m     def evaluate(self, x=None, y=None,\n",
      "\u001B[0;32m~/anaconda3/envs/HARedit/lib/python3.6/site-packages/keras/engine/training_arrays.py\u001B[0m in \u001B[0;36mfit_loop\u001B[0;34m(model, f, ins, out_labels, batch_size, epochs, verbose, callbacks, val_f, val_ins, shuffle, callback_metrics, initial_epoch, steps_per_epoch, validation_steps)\u001B[0m\n\u001B[1;32m    197\u001B[0m                     \u001B[0mins_batch\u001B[0m\u001B[0;34m[\u001B[0m\u001B[0mi\u001B[0m\u001B[0;34m]\u001B[0m \u001B[0;34m=\u001B[0m \u001B[0mins_batch\u001B[0m\u001B[0;34m[\u001B[0m\u001B[0mi\u001B[0m\u001B[0;34m]\u001B[0m\u001B[0;34m.\u001B[0m\u001B[0mtoarray\u001B[0m\u001B[0;34m(\u001B[0m\u001B[0;34m)\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[1;32m    198\u001B[0m \u001B[0;34m\u001B[0m\u001B[0m\n\u001B[0;32m--> 199\u001B[0;31m                 \u001B[0mouts\u001B[0m \u001B[0;34m=\u001B[0m \u001B[0mf\u001B[0m\u001B[0;34m(\u001B[0m\u001B[0mins_batch\u001B[0m\u001B[0;34m)\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[0m\u001B[1;32m    200\u001B[0m                 \u001B[0mouts\u001B[0m \u001B[0;34m=\u001B[0m \u001B[0mto_list\u001B[0m\u001B[0;34m(\u001B[0m\u001B[0mouts\u001B[0m\u001B[0;34m)\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[1;32m    201\u001B[0m                 \u001B[0;32mfor\u001B[0m \u001B[0ml\u001B[0m\u001B[0;34m,\u001B[0m \u001B[0mo\u001B[0m \u001B[0;32min\u001B[0m \u001B[0mzip\u001B[0m\u001B[0;34m(\u001B[0m\u001B[0mout_labels\u001B[0m\u001B[0;34m,\u001B[0m \u001B[0mouts\u001B[0m\u001B[0;34m)\u001B[0m\u001B[0;34m:\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n",
      "\u001B[0;32m~/anaconda3/envs/HARedit/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py\u001B[0m in \u001B[0;36m__call__\u001B[0;34m(self, inputs)\u001B[0m\n\u001B[1;32m   2713\u001B[0m                 \u001B[0;32mreturn\u001B[0m \u001B[0mself\u001B[0m\u001B[0;34m.\u001B[0m\u001B[0m_legacy_call\u001B[0m\u001B[0;34m(\u001B[0m\u001B[0minputs\u001B[0m\u001B[0;34m)\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[1;32m   2714\u001B[0m \u001B[0;34m\u001B[0m\u001B[0m\n\u001B[0;32m-> 2715\u001B[0;31m             \u001B[0;32mreturn\u001B[0m \u001B[0mself\u001B[0m\u001B[0;34m.\u001B[0m\u001B[0m_call\u001B[0m\u001B[0;34m(\u001B[0m\u001B[0minputs\u001B[0m\u001B[0;34m)\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[0m\u001B[1;32m   2716\u001B[0m         \u001B[0;32melse\u001B[0m\u001B[0;34m:\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[1;32m   2717\u001B[0m             \u001B[0;32mif\u001B[0m \u001B[0mpy_any\u001B[0m\u001B[0;34m(\u001B[0m\u001B[0mis_tensor\u001B[0m\u001B[0;34m(\u001B[0m\u001B[0mx\u001B[0m\u001B[0;34m)\u001B[0m \u001B[0;32mfor\u001B[0m \u001B[0mx\u001B[0m \u001B[0;32min\u001B[0m \u001B[0minputs\u001B[0m\u001B[0;34m)\u001B[0m\u001B[0;34m:\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n",
      "\u001B[0;32m~/anaconda3/envs/HARedit/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py\u001B[0m in \u001B[0;36m_call\u001B[0;34m(self, inputs)\u001B[0m\n\u001B[1;32m   2673\u001B[0m             \u001B[0mfetched\u001B[0m \u001B[0;34m=\u001B[0m \u001B[0mself\u001B[0m\u001B[0;34m.\u001B[0m\u001B[0m_callable_fn\u001B[0m\u001B[0;34m(\u001B[0m\u001B[0;34m*\u001B[0m\u001B[0marray_vals\u001B[0m\u001B[0;34m,\u001B[0m \u001B[0mrun_metadata\u001B[0m\u001B[0;34m=\u001B[0m\u001B[0mself\u001B[0m\u001B[0;34m.\u001B[0m\u001B[0mrun_metadata\u001B[0m\u001B[0;34m)\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[1;32m   2674\u001B[0m         \u001B[0;32melse\u001B[0m\u001B[0;34m:\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[0;32m-> 2675\u001B[0;31m             \u001B[0mfetched\u001B[0m \u001B[0;34m=\u001B[0m \u001B[0mself\u001B[0m\u001B[0;34m.\u001B[0m\u001B[0m_callable_fn\u001B[0m\u001B[0;34m(\u001B[0m\u001B[0;34m*\u001B[0m\u001B[0marray_vals\u001B[0m\u001B[0;34m)\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[0m\u001B[1;32m   2676\u001B[0m         \u001B[0;32mreturn\u001B[0m \u001B[0mfetched\u001B[0m\u001B[0;34m[\u001B[0m\u001B[0;34m:\u001B[0m\u001B[0mlen\u001B[0m\u001B[0;34m(\u001B[0m\u001B[0mself\u001B[0m\u001B[0;34m.\u001B[0m\u001B[0moutputs\u001B[0m\u001B[0;34m)\u001B[0m\u001B[0;34m]\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[1;32m   2677\u001B[0m \u001B[0;34m\u001B[0m\u001B[0m\n",
      "\u001B[0;32m~/anaconda3/envs/HARedit/lib/python3.6/site-packages/tensorflow/python/client/session.py\u001B[0m in \u001B[0;36m__call__\u001B[0;34m(self, *args, **kwargs)\u001B[0m\n\u001B[1;32m   1437\u001B[0m           ret = tf_session.TF_SessionRunCallable(\n\u001B[1;32m   1438\u001B[0m               \u001B[0mself\u001B[0m\u001B[0;34m.\u001B[0m\u001B[0m_session\u001B[0m\u001B[0;34m.\u001B[0m\u001B[0m_session\u001B[0m\u001B[0;34m,\u001B[0m \u001B[0mself\u001B[0m\u001B[0;34m.\u001B[0m\u001B[0m_handle\u001B[0m\u001B[0;34m,\u001B[0m \u001B[0margs\u001B[0m\u001B[0;34m,\u001B[0m \u001B[0mstatus\u001B[0m\u001B[0;34m,\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[0;32m-> 1439\u001B[0;31m               run_metadata_ptr)\n\u001B[0m\u001B[1;32m   1440\u001B[0m         \u001B[0;32mif\u001B[0m \u001B[0mrun_metadata\u001B[0m\u001B[0;34m:\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[1;32m   1441\u001B[0m           \u001B[0mproto_data\u001B[0m \u001B[0;34m=\u001B[0m \u001B[0mtf_session\u001B[0m\u001B[0;34m.\u001B[0m\u001B[0mTF_GetBuffer\u001B[0m\u001B[0;34m(\u001B[0m\u001B[0mrun_metadata_ptr\u001B[0m\u001B[0;34m)\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n",
      "\u001B[0;31mKeyboardInterrupt\u001B[0m: "
     ]
    }
   ],
   "source": [
    "train_val(epochs=title_param[\"epochs\"], batch_size=title_param[\"batch_size\"], data_id=title_param[\"data_id\"])"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}